#ifndef _TIMER_H
#define _TIMER_H

class CTimer
{

public:

	//Constructor and destructor 
	CTimer();
	~CTimer()		{}

    //Variable access functions 
    int getFPS()				{ return fps; }
    float getElapsed()			{ return elapsed; }
    float getElapsedSqrd()		{ return elapsed2; }
    long getTime()				{ return timer; }
	
	void setElapsed(float Elapsed)		{ elapsed = Elapsed; elapsed2 = Elapsed * Elapsed; }
	
	//Updates the timer
    void update();
    
private:

	int 	fps;			//FPS of the engine
    float 	elapsed;		//Time elapsed since last frame
    float 	elapsed2;		//Elapsed squared
    long 	timer;			//Current time
    //long 	elapsedold;
    //float 	elapsedchange;	//Current elapsed value divided by the previous elapsed value for time corrected Verlet integration     

    long 	FPSCounter;		//Holds the current FPS count
    long 	FrameTimer;		//Holds the time of the last FPS update
    

};

#endif //_TIMER_H 
